# Contributor: Johannes Matheis <jomat+alpinebuild@jmt.gr>
# Maintainer: Johannes Matheis <jomat+alpinebuild@jmt.gr>
pkgname=jq
pkgver=1.6
pkgrel=1
pkgdesc="A lightweight and flexible command-line JSON processor"
url="https://stedolan.github.io/jq/"
arch="all"
license="MIT"
makedepends="oniguruma-dev automake autoconf libtool"
subpackages="$pkgname-doc $pkgname-dev"
source="https://github.com/stedolan/jq/archive/jq-$pkgver.tar.gz"
builddir="$srcdir/$pkgname-$pkgname-$pkgver"

# secfixes:
#   1.6_rc1-r0:
#     - CVE-2016-4074

prepare() {
	default_prepare
	autoreconf -fi
}

build() {
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--localstatedir=/var \
		--disable-docs
	make
}

check() {
	make check
}

package() {
	make DESTDIR="$pkgdir" prefix=/usr install
}

sha512sums="e707682239c9a3e6c31c2ce0d433c35140d88881d25637cefa880e0ae288b7746497b73b25403ad11134707c755979bee455523fb32b77a716f101f1e07a1149  jq-1.6.tar.gz"
